import request from "@/service/request";
import {PromisePageResponse, PromiseResponse} from "@/service/api/type.ts";
import {SysOperationalLogVo} from "@/service/api/system/operation/types.ts";

/**
 * 获取操作日志列表
 * @param query
 */
const getOperationalLogList = (query: any): PromisePageResponse<SysOperationalLogVo> => {
  return request({
    url: "/system/operationalLog/list",
    method: "get",
    params: query,
  });
};

/**
 * 获取操作日志详情
 * @param id
 */
const getOperationalLogDetail = (id: string): PromiseResponse<SysOperationalLogVo> => {
  return request({
    url: `/system/operationalLog/${id}`,
    method: "get",
  });
};

/**
 * 批量删除
 * @param ids
 */
const deleteOperationalLog = (ids: string|string[]): PromiseResponse<any> => {
  return request({
    url: `/system/operationalLog/${ids}`,
    method: "delete",
  });
}

/**
 * 清空操作日志
 */
const cleanOperationalLog = (): PromiseResponse<any> => {
  return request({
    url: "/system/operationalLog/clean",
    method: "delete",
  });
}

export { getOperationalLogList, getOperationalLogDetail,deleteOperationalLog, cleanOperationalLog };
